home *** CD-ROM | disk | FTP | other *** search
- <%@ Language=VBScript CODEPAGE=65001 %>
- <!--#include file="include/wmsConstants.inc"-->
- <!--#include file="include/wmsLocStrings.inc"-->
- <!--#include file="include/wmsCommon.inc"-->
- <!--#include file="include/wmsHeader.inc"-->
- <!--#include file="include/wmsServerHash.inc"-->
- <!--#include file="include/wmsconnect.inc"-->
- <!--#include file="include/wmsError.inc"-->
- <!--#include file="include/wmsToolbar.inc"-->
- <!--#include file="include/wmsHelp.inc"-->
- <!--#include file="include/wmsPageBanner.inc"-->
- <!--#include file="include/wmsTabs.inc"-->
- <%
- '+-------------------------------------------------------------------------
- '
- ' Microsoft Windows Media
- ' Copyright (C) Microsoft Corporation. All rights reserved.
- '
- ' File: PubPoint_Media.asp
- '
- ' Contents:
- '
- '--------------------------------------------------------------------------
-
- BeginErrorHandling
- ConnectToServer
- ConnectToPubPoint
-
- Dim bBroadcastPubPoint
- Dim bBroadcastPPStarted
- Dim bBroadcastPPArchiving
- Dim strPubPointPath
- Dim bError
- bError = FALSE
-
- strPubPointPath = ""
- bBroadcastPPStarted = FALSE
-
- if( empty = g_objPubPoint ) then
- Server.Transfer( "pubpoint_collection.asp" )
- end if
-
- Dim bArrivedFromServerSideTransfer
- bArrivedFromServerSideTransfer = Session( "bUpdateTreeView" ) and ( 0 = Len( qs("error") ) )
- if( bArrivedFromServerSideTransfer ) then
- Session( "bUpdateTreeView" ) = FALSE
- Response.Redirect( "pubpoint_media.asp?server=" & g_strQueryStringServer & "&bUpdateTree=true&ppID=" & g_strPubPointID )
- Response.Flush
- end if
-
- on error resume next
-
- bBroadcastPPArchiving = FALSE
-
- dwPPType = g_objPubPoint.Type
- if WMS_PUBLISHING_POINT_TYPE_BROADCAST = dwPPType then
- bBroadcastPubPoint = TRUE
- dwPPStatus = g_objPubPoint.BroadcastStatus
- bBroadcastPPStarted = ( 0 <> ( WMS_BROADCAST_PUBLISHING_POINT_STARTED and dwPPStatus ) ) or _
- ( 0 <> ( WMS_BROADCAST_PUBLISHING_POINT_STARTED_WITHOUT_DATA and dwPPStatus ) )
- bBroadcastPPArchiving = ( 0 <> ( WMS_BROADCAST_PUBLISHING_POINT_ARCHIVING and dwPPStatus ) )
- else
- bBroadcastPubPoint = FALSE
- end if
-
- bAllowingConnections = g_objPubPoint.AllowClientsToConnect
- bDrawWarning = FALSE
-
- szPubPointHiddenPath = TrimFileColon( SafeUnescape( GetPostOrQsVal("HiddenPath") ) )
- strPubPointPath = TrimFileColon( SafeUnescape( GetPostOrQsVal("Path") ) )
-
- if( Len( szPubPointHiddenPath ) = Len( strPubPointPath ) ) then
- strPubPointPath = szPubPointHiddenPath
- end if
-
- strPubPointPath = Left( strPubPointPath, MAX_PATH )
- ' use a do-while-false structure to break out upon first error
- do
- if( FALSE = PPPathIsLegal( strPubPointPath ) ) then
- err.Raise( -1 )
- err.Description = CStr( L_INVALIDCHARSINPATH_TEXT )
- bError = ErrorDetected ( "Path" )
- Session( "PageReloadedToDisplayError" ) = 1
- Exit Do
- end if
-
- if( 0 < Len( strPubPointPath ) )then
- g_objPubPoint.path = strPubPointPath
- if not ErrorDetected( "PubPointSourceURL" ) then
- Response.Redirect( "pubpoint_media.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID )
- Response.end
- end if
- elseif( "" = qs("s") ) and ( "" = qs("op") ) then
- Session( "ErrorNumber" ) = 0
- Err.Clear
- end if
-
- Loop Until TRUE
-
- if ( Err.number <> 0 ) and ( 0 <> Session( "ErrorNumber" ) ) then
- bError = TRUE
- end if
-
- if( 0 = Len( strPubPointPath ) ) then
- strPubPointPath = TrimFileColon( g_objPubPoint.Path )
- strPubPointPath = TrimFileColon( g_objPubPoint.Path )
- ' strPubPointPath = Server.HTMLEncode( strPubPointPath )
- ' strPubPointPath = RemoveSpecifiedChars( strPubPointPath, REGEXP_ILLEGAL_PPSRC_CHARS )
- end if
-
- '/////////////////////////////////////////////////////////////////////
- Function PPPathIsLegal( strPubPointPath )
- PPPathIsLegal = TRUE
- Dim regEx
- Set regEx = New RegExp
- regEx.Pattern = "/;|\^|\'|\<|\>|\`|\f|\n|\r/gi"
- regEx.IgnoreCase = TRUE
- regEx.Global = TRUE
- regEx.Multiline = TRUE
- if( TRUE = regEx.Test( strPubPointPath ) ) then
- PPPathIsLegal = FALSE
- Exit Function
- end if
- End Function
-
- '////////////////////////////////////////////////////////////////
- Function GetFormStr( szKey )
- GetFormStr = trim( CStr( posting( szKey ) ) )
- End Function
-
- '////////////////////////////////////////////////////////////////
- Function GetPostOrQsVal( szKey )
- Dim szVal
- szVal = GetFormStr( szKey )
-
- if( 0 = Len( szVal ) ) then
- szVal = CStr( qs( szKey ) )
- end if
-
- GetPostOrQsVal = szVal
- End Function
-
- '////////////////////////////////////////////////////////////////
- Function UnescapeFilePathSlashes( szUrl )
- UnescapeFilePathSlashes = Replace( szUrl, "\", "\\" )
- End Function
-
- '/////////////////////////////////////////////////////////////////////////////////////
- Function CanArchiveBeEnabled()
- on error resume next
-
- if( IsEmpty( g_objPubPoint ) ) then
- CanArchiveBeEnabled = FALSE
- Exit Function
- end if
-
- Dim objPluginCollection
- Dim objPlugin
- Dim strSubCategory
- Dim lPluginCount
- Dim i
- Dim strCurPluginSubcategory
-
- Set objPluginCollection = g_objPubPoint.BroadcastDataSinks
- strSubCategory = ARCHIVER_SUBCAT
-
- if( nothing <> objPluginCollection ) then
- lPluginCount = objPluginCollection.Count
- else
- lPluginCount = 0
- end if
-
- Do While ( i < lPluginCount )
- Set objPlugin = objPluginCollection( i )
- strCurPluginSubcategory = objPlugin.Properties( "SubCategory" )
- if( ( 0 < Len( strCurPluginSubcategory ) ) and ( 0 = StrComp( strCurPluginSubcategory, ARCHIVER_SUBCAT, vbTextCompare ) ) ) then
- if( WMS_PLUGIN_ENABLED and objPlugin.Status ) then
- CanArchiveBeEnabled = TRUE
- Exit Function
- end if
- end if
- i = i + 1
- Loop
-
- CanArchiveBeEnabled = FALSE
- End Function
-
- %>
- <% WriteHTMLHeader( g_strDecodedServerName ) %>
- <link rel="stylesheet" type="text/css" href="<%= Session( "cssName" ) %>">
- <script language="JavaScript" src="include/WMSCommon.js"></script>
- <script language=JavaScript>
- <!--
- /*@cc_on @*/
- <% WriteCommonJSUtils %>
-
- var g_bPathAlerted = false;
- var g_bPushAlerted = false;
-
- ///////////////////////////////////////////////////////////////////////
- function ValidatePath()
- {
- <% jsTRY %>
- <% if TRUE = bBroadcastPPStarted then %>
- document.forms.mainForm.change.disabled = false;
- return( false );
- <% end if %>
-
- var szPath = new String( document.forms.mainForm.path.value );
- var szIllegalChars = /;|\^|\'|\<|\>|\`|\f|\n|\r/gi;
- var szPathUpperCase = null;
-
- // perform left trim
- szPath = szPath.replace( /^\s+/, "" );
-
- // perform right trim
- szPath = szPath.replace( /\s+$/, "" );
-
- if( -1 != szPath.search( szIllegalChars ) )
- {
- document.forms.mainForm.path.style.color = "#ff0000";
- document.forms.mainForm.change.disabled = true;
- window.status = "<%= L_INVALIDCHARSINPATH_TEXT %>";
- if( ! g_bPathAlerted )
- {
- g_bPathAlerted = true;
- window.alert( "<%= L_INVALIDCHARSINPATH_TEXT %>" );
- }
- return;
- }
-
- window.status = "";
- document.forms.mainForm.path.style.color = "#000000";
- szPathUpperCase = new String( szPath.toUpperCase() );
- if( ( 0 < szPath.length ) && ( szPathUpperCase != "<%= UCase( Server.HTMLEncode( UnescapeFilePathSlashes( strPubPointPath ) ) ) %>" ) )
- {
- document.forms.mainForm.change.disabled = false;
- }
- else
- {
- document.forms.mainForm.change.disabled = true;
- }
- <% if( WMS_PUBLISHING_POINT_TYPE_ON_DEMAND = dwPPType ) then %>
- szPathPrefix = szPath.slice( 0, 5 );
-
- if( szPathPrefix == "push:" )
- {
- document.forms.mainForm.path.style.color = "#ff0000";
- document.forms.mainForm.change.disabled = true;
-
- window.status = "<%= RemoveDangerousCharacters( L_ODPPSRCCHANGETOPUSH_TEXT ) %>";
- if( ! g_bPushAlerted )
- {
- g_bPushAlerted = true;
- window.alert( "<%= RemoveDangerousCharacters( L_ODPPSRCCHANGETOPUSH_TEXT ) %>" );
- }
- return( false );
- }
-
- document.forms.mainForm.path.style.color = "#000000";
- document.forms.mainForm.change.disabled = false;
- window.status = "";
- <% end if %>
-
- return( true );
- <% jsCATCH %>
- }
-
- ///////////////////////////////////////////////////////////////////////
- function ValidateInput()
- {
- <% jsTRY %>
- var bRetVal;
-
- bRetVal = ValidatePath();
-
- if( ! bRetVal || document.mainForm.change.disabled )
- {
- event.cancelBubble=1;
- return false;
- }
-
- strPath = new String( document.forms.mainForm.path.value );
- strPath = SafeEscape( strPath );
- document.forms.mainForm.HiddenPath.value = strPath;
- <% jsCATCH %>
- }
- -->
- </script>
- </head>
- <body bgcolor="#FFFFFF" topmargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0" <% if ( "" <> qs("bUpdateTree") ) then %>onLoad="JavaScript:UpdateTreeView();"<% end if %> oncontextmenu="JavaScript:event.cancelBubble=true;return false;">
- <%
- ' Draw the page banner and tabs
- DrawPPNameBanner L_MEDIATABTITLE_TEXT
- %>
- <br>
- <form name="mainForm" method="post" action="<%= RemoveDangerousCharacters( g_strQueryString ) %>" onsubmit="JavaScript:return( ValidateInput() );" AUTOCOMPLETE="OFF">
- <input type="hidden" name="server" value="<%= RemoveSpecifiedChars( g_strQueryStringServer, "\f|\n|\r|<|>" ) %>">
- <input type="hidden" name="ppID" value="<%= RemoveSpecifiedChars( g_strPubPointID, "\f|\n|\r|<|>" ) %>">
- <input type="hidden" name="HiddenPath" value="">
- <table bgcolor="#FFFFFF" width="100%" cellspacing="5" border="0">
- <tr>
- <td>
- <table width="100%" cellspacing="0" cellpadding="0" border="0">
- <tr>
- <td>
- <span class="helptext">
- <div class="helptext"><%= Server.HTMLEncode( L_MEDIATABHELPSTRING_TEXT ) %></div>
- </span><br>
- </td>
- </tr>
- </table>
- </td>
- <tr>
- <td colspan=4>
- <span class=subheader>
- <%
- RenderWithErrorCheck Server.HTMLEncode( L_PUBLISHINGPOINTPATHCOLON_TEXT ), "mainForm"
- %>
- </span>
- <br>
- <input <% if bBroadcastPPStarted then %> disabled <% end if %>
- size="<% if brMSIE = g_dwBrowserType then %>60<% else %>80<% end if %>"
- type="text"
- name="path"
- maxlength="<%= Server.HTMLEncode( MAX_PATH ) %>"
- value="<%= Server.HTMLEncode( strPubPointPath ) %>"
- onChange="JavaScript:ValidatePath()"
- onPaste="JavaScript:ValidatePath()"
- onKeyDown="JavaScript:ValidatePath()"
- onKeyUp="JavaScript:ValidatePath()"
- tabIndex=<%= dwTabIndex %> <% dwTabIndex = dwTabIndex + 1 %>
- AUTOCOMPLETE="OFF" >
- <input
- type="submit"
- value="<%= Server.HTMLEncode( L_APPLYBUTTON_TEXT ) %>"
- id="change"
- name="change"
- align="left"
- tabIndex=<%= dwTabIndex %> <% dwTabIndex = dwTabIndex + 1 %>
- disabled>
- </td>
- </tr>
- <tr>
-
- <td>
- <p>
- <table width="<%= STDTABLEWIDTH %>" border="0">
- <tr>
- <td colspan=4>
- <div class=header>
- <%' L_PLAYLISTEDITORUNAVAILABLE_TEXT %>
- </div>
- </td>
- </tr>
- </table>
- <p>
- </td>
-
- <tr>
- <td colspan=5> <br><!-- <img src="img/hr.gif" width="<%= STDTABLEWIDTH %>" height=2> --></td>
- </tr>
- <tr>
- <td>
- <p>
- <%
- Dim dwLastButton
-
- dwLastButton = 0
-
- if bBroadcastPubPoint then
- ToolbarButtonText ( dwLastButton ) = L_BUTTONSTART_TEXT
- if( bBroadcastPPStarted ) then
- ToolbarButtonImage( dwLastButton ) = IMAGE_PP_STARTG
- ToolbarButtonLink ( dwLastButton ) = ""
- else
- ToolbarButtonImage( dwLastButton ) = IMAGE_PP_START
- ToolbarButtonLink ( dwLastButton ) = "pp_action.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&op=start&referrer=pubpoint_media.asp"
- end if
- ToolbarButtonAltText( dwLastButton ) = L_STARTTHEPUBPOINT_TEXT
-
- dwLastButton = dwLastButton + 1
- ToolbarButtonText ( dwLastButton ) = L_BUTTONSTOP_TEXT
- if( bBroadcastPPStarted ) then
- ToolbarButtonImage( dwLastButton ) = IMAGE_STOP
- ToolbarButtonLink ( dwLastButton ) = "pp_action.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&op=stop&referrer=pubpoint_media.asp"
- else
- ToolbarButtonImage( dwLastButton ) = IMAGE_STOPG
- ToolbarButtonLink ( dwLastButton ) = ""
- end if
- ToolbarButtonAltText( dwLastButton ) = L_STOPTHEPUBPOINT_TEXT
- dwLastButton = dwLastButton + 1
-
- if( bBroadcastPPStarted ) then
- if( bBroadcastPPArchiving ) then
- ToolbarButtonText ( dwLastButton ) = L_BUTTONSTARTARCHIVE_TEXT
- ToolbarButtonImage( dwLastButton ) = IMAGE_PP_STARTRECORDG
- ToolbarButtonLink ( dwLastButton ) = ""
- ToolbarButtonAltText( dwLastButton ) = L_STARTARCHIVE_TEXT
- dwLastButton = dwLastButton + 1
-
- ToolbarButtonText ( dwLastButton ) = L_BUTTONSTOPARCHIVE_TEXT
- ToolbarButtonImage( dwLastButton ) = IMAGE_PP_STOPRECORD
- ToolbarButtonLink ( dwLastButton ) = "pp_action.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&op=stopArchiving&referrer=pubpoint_media.asp"
- ToolbarButtonAltText( dwLastButton ) = L_STOPARCHIVE_TEXT
- dwLastButton = dwLastButton + 1
- elseif( FALSE = CanArchiveBeEnabled() ) then
- ToolbarButtonText ( dwLastButton ) = L_BUTTONSTARTARCHIVE_TEXT
- ToolbarButtonImage( dwLastButton ) = IMAGE_PP_STARTRECORDG
- ToolbarButtonLink ( dwLastButton ) = ""
- ToolbarButtonAltText( dwLastButton ) = L_STARTARCHIVE_TEXT
- dwLastButton = dwLastButton + 1
-
- ToolbarButtonText ( dwLastButton ) = L_BUTTONSTOPARCHIVE_TEXT
- ToolbarButtonImage( dwLastButton ) = IMAGE_PP_STOPRECORDG
- ToolbarButtonLink ( dwLastButton ) = ""
- ToolbarButtonAltText( dwLastButton ) = L_STOPARCHIVE_TEXT
- dwLastButton = dwLastButton + 1
- else
- ToolbarButtonText ( dwLastButton ) = L_BUTTONSTARTARCHIVE_TEXT
- ToolbarButtonImage( dwLastButton ) = IMAGE_PP_STARTRECORD
- ToolbarButtonLink ( dwLastButton ) = "pp_action.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&op=startArchiving&referrer=pubpoint_media.asp"
- ToolbarButtonAltText( dwLastButton ) = L_STARTARCHIVE_TEXT
- dwLastButton = dwLastButton + 1
-
- ToolbarButtonText ( dwLastButton ) = L_BUTTONSTOPARCHIVE_TEXT
- ToolbarButtonImage( dwLastButton ) = IMAGE_PP_STOPRECORDG
- ToolbarButtonLink ( dwLastButton ) = ""
- ToolbarButtonAltText( dwLastButton ) = L_STOPARCHIVE_TEXT
- dwLastButton = dwLastButton + 1
- end if
- else
- ToolbarButtonText ( dwLastButton ) = L_BUTTONSTARTARCHIVE_TEXT
- ToolbarButtonImage( dwLastButton ) = IMAGE_PP_STARTRECORDG
- ToolbarButtonLink ( dwLastButton ) = ""
- ToolbarButtonAltText( dwLastButton ) = L_STARTARCHIVE_TEXT
- dwLastButton = dwLastButton + 1
-
- ToolbarButtonText ( dwLastButton ) = L_BUTTONSTOPARCHIVE_TEXT
- ToolbarButtonImage( dwLastButton ) = IMAGE_PP_STOPRECORDG
- ToolbarButtonLink ( dwLastButton ) = ""
- ToolbarButtonAltText( dwLastButton ) = L_STOPARCHIVE_TEXT
- dwLastButton = dwLastButton + 1
- end if
-
- end if
-
- ToolbarButtonText ( dwLastButton ) = L_BUTTONALLOWNEWCONNECTIONS_TEXT
- if( FALSE = bAllowingConnections )then
- ToolbarButtonImage( dwLastButton ) = IMAGE_ALLOWCONNECTIONS
- ToolbarButtonLink ( dwLastButton ) = "pp_action.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&op=allow&referrer=pubpoint_media.asp"
- else
- ToolbarButtonImage( dwLastButton ) = IMAGE_ALLOWCONNECTIONSG
- ToolbarButtonLink ( dwLastButton ) = ""
- end if
- ToolbarButtonAltText( dwLastButton ) = L_ALLOWUCONNECTIONS_TEXT
-
- dwLastButton = dwLastButton + 1
- ToolbarButtonText ( dwLastButton ) = L_BUTTONDENYNEWCONNECTIONS_TEXT
- if( bAllowingConnections )then
- ToolbarButtonImage( dwLastButton ) = IMAGE_DENYCONNECTIONS
- ToolbarButtonLink ( dwLastButton ) = "pp_action.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&op=deny&referrer=pubpoint_media.asp"
- else
- ToolbarButtonImage( dwLastButton ) = IMAGE_DENYCONNECTIONSG
- ToolbarButtonLink ( dwLastButton ) = ""
- end if
- ToolbarButtonAltText( dwLastButton ) = L_DENYUCONNECTIONS_TEXT
-
- if( Session( "ShowServerList" ) ) then
- dwLastButton = dwLastButton + 1
- ToolbarButtonText ( dwLastButton ) = L_BUTTONRETURNTOSERVERLIST_TEXT
- ToolbarButtonImage( dwLastButton ) = IMAGE_SERVERLIST
- ToolbarButtonLink ( dwLastButton ) = SERVERSLIST_PATH
- ToolbarButtonAltText( dwLastButton ) = L_RETURNTOSL_TEXT
- end if
-
- dwLastButton = dwLastButton + 1
- ToolbarButtonText ( dwLastButton ) = L_BUTTONHELP_TEXT
- ToolbarButtonImage( dwLastButton ) = IMAGE_HELP
- ToolbarButtonLink ( dwLastButton ) = HELPTOKEN
- ToolbarButtonAltText( dwLastButton ) = L_HELPALT_TEXT
- ToolbarHelpURL = H_PPMEDIAHELPTOPIC
- ToolbarNesting = H_PPLEVEL
-
- dwLastButton = dwLastButton + 1
- DrawToolbar TRUE, dwLastButton %>
- </td>
- </tr>
-
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </form>
- <%
- DrawCopyrightInfo
- DrawStdFooter
-
- dwQSError = CStr( qs("error") )
- if( 0 = Err.number ) then
- if( 0 < Len( dwQSError ) ) then
- Err.number = CDbl( dwQSError )
- Session( "PageReloadedToDisplayError" ) = 1
- end if
- end if
- AlertUserWithPopupErrorDialog
- OnErrorGoBack
- %>
- </body>
- </html>
- <%
- LatchCurrentPage "pubpoints/pubpoint_media.asp", qs
- EndErrorHandling "pubpoint_media.asp"
-
- WMSServerHashASPCleanup
- WMSConnectASPCleanup
- %>